package cn.project.lemontree.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
    private Integer userid;
    private String username;
    private String telephone;
    private String password;

    public User(Parent parent){
        this.userid = parent.getParentId();
        this.username = parent.getParentName();
        this.telephone = parent.getTelephone();
        this.password = parent.getPassword();
    }

    public User(Teacher teacher){
        this.userid = teacher.getTeacherId();
        this.username = teacher.getTeacherName();
        this.telephone = teacher.getTelephone();
        this.password = teacher.getPassword();
    }

    public User(Administrator administrator){
        this.userid = administrator.getId();
        this.username = administrator.getUsername();
        this.telephone = administrator.getTelephone();
        this.password = administrator.getPassword();
    }
}
